home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Aminet 2
/
Aminet AMIGA CDROM (1994)(Walnut Creek)[Feb 1994][W.O. 44790-1].iso
/
Aminet
/
gfx
/
misc
/
lise20.lha
/
lise2.0
/
mdl
/
src
/
mdl.doc
< prev
next >
Wrap
Text File
|
1993-03-31
|
7KB
|
157 lines
Documentation for the
Menu Description Language Interpreter
- - -
(c) 1990 by Rainer Kowallik
What is this ?
______________
In principle you can think of mdl as an menu extension to the
Korn Shell for UNIX (and also for the Amiga !)
You need to write a menu description file, which consists of
the names of some menu items, together with assotiated variable
names (as though there where ksh variables) or (inclusive)
ksh commands to be executed.
The commands are executed when the specified button is pressed.
Any known ksh command is valid. Commands may continue on the next line,
and may be separated by a semicolon.
But remember: the whole command is packed into one single string,
NL is replaced by semicolon, and this string is passed to the kshell.
The size of this string should not exceed 8K !
Menu creation commands:
________________________
x,y are the coordinates of the item. Set these coordinates to -1,-1 if you
want just to have the next available position
FACTOR{factor_x,factor_y} sets scaling factors
to ease poring scripts
to other workstations
SIZE {x,y,inc} sets the window size and
y-increment.
MUST be the first command !
LANGUAGE{interpreter to execute with options}
sets an alternate execution
interpreter (e.g. csh)
STARTUP {"commands"} These commands are executeted
before the menu will be
displayed. You may specify
more than 1 STARTUP routine
The startup routines are called
in the correct order and
state of progress.
NEW_MENU {"name"} creating new entry on menue bar
MENU {"name"}{"command_string"} creating new menu item in
the actual category
RADIO subsequent TOGGLE calls are
packed as "radio box"
TOGGLE {x,y,"name"}{"variable"} generates a toggle button
and assigns its value to
the given variable
PUSH {x,y,"name"}{"command_string"} generates a push button and
assignes a command string
to the button, which will be
executed, when the button is
pressed.
SCALEX {x,y,"name",min,max}{"variable"} generates a slider and assigns
Y its value to the given variable
The size is proprtional to
(max-min) (should be !)
SCALEX11 {x,y,"name",min,max}{"variable"} generates a slider and assigns
Y its value to the given variable
The size is proprtional to
(max-min) (should be !)
STRING_BOX{x,y,"name"}{"variable"}{"command_string"}
creates a single line Text
input field
SELECTION{x,y,"name,item1,item2,..."}{"variable"}{"command_string"}
creates a selection box with
given items in its window.
The Variable name is assigned
to its value, and the command
string will be executed when
you hit OK.
FILE_SELECT{x,y,"name"}{"variable"}{"command_string"}
creates a file selection box.
The Variable name is assigned
to its value, and the command
string will be executed when
you hit OK.
Command string parsing:
_______________________
When you hit a button, the corresponding commandstring will be parsed in two
steps:
1. It is searched for any '$' string, and the following variable substitution.
If the variable is found, it will be substituted.
2. The string will pe passed to the Korn-Shell. This allows for any known
ksh construct to be parsed.
The resulting output (if any) will be displayed on a Help window.
If the resulting string is
"EXIT" the program exits. This allows you
to terminate the program by an "echo EXIT"
statement on special conditions.
"CD dir" the working directory is changed
"SET var val" the pseudo variable "var" is set to "val"
(only usefull for STRING_BOX types)
Predifined "variable names":
____________________________
In fact these variables are more like Function calls, since they interact with
the user to return a value.
HELP{"string"} The string will be displayed in
a help window.
STRINGBOX{"title,option"} The user is asked to enter a
string. Option is first inserted
FILESELECT{"root"} A file selection box is called.
EXIT exits the program
Resource definition (UNIX only):
________________________________
If the very first character in your file is an open curley bracket {
then the text between this bracket and the corresponding closing bracket }
is copied to /usr/lib/X11/app-defaults/mdl.tmp and handled to the
Toolkit open routines as resource file.
Amiga goodies:
--------------
NAME{name} sets the name in the titlebar
sets an alternative Language
SIZE{x,y,inc,top,left} can additionally set the window
position